package com.whfc.fse.dao;

import com.whfc.fse.dto.FseCraneRecordDTO;
import com.whfc.fse.dto.OpenApiFseCraneRecordDTO;
import com.whfc.fse.entity.FseCraneRecord;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface FseCraneRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(FseCraneRecord record);

    int insertSelective(FseCraneRecord record);

    FseCraneRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(FseCraneRecord record);

    int updateByPrimaryKey(FseCraneRecord record);

    List<FseCraneRecordDTO> selectByDeptIdAndTime(@Param("deptId") Integer deptId,
                                                  @Param("startTime") Date startTime,
                                                  @Param("endTime") Date endTime,
                                                  @Param("keyword") String keyword);


    List<OpenApiFseCraneRecordDTO> selectBySnsAndTime(@Param("sns")List<String> sns,
                                                      @Param("startTime")Date startTime,
                                                      @Param("endTime")Date endTime);

    /**
     * 获取最新更新时间
     * @param craneId 塔机ID
     * @return 更新时间
     */
    Date getLastUpTimeByCraneId(Integer craneId);
}